home *** CD-ROM | disk | FTP | other *** search
/ Satanic Rites 1 / Satanic Rites - Issue 1 (1992-05-17)(Destiny).adf / T / Checksum < prev    next >
Text File  |  2021-10-01  |  2KB  |  112 lines

  1.      {3Cyclic redundancy checksum           
  2.  {5A lame routine by Terminator/Destiny
  3.  
  4.  
  5. {6Hullo, {7this routine will stop people
  6. changing the texts in your creations.
  7. Its really simple.  Unfortunatly, It
  8. will only checksum data and not code.
  9. I.e.
  10.  
  11. {4Dc.b "Greetings to the triple headed
  12. frog from saturn"
  13.  
  14. {1can be checksumed but ...
  15.  
  16. {4Loop:  Bra.s   Loop(Or any other code)
  17.  
  18. {1can't be checksummed.  This is coz the
  19. code could load at a different address
  20. i.e.  Say when you assembled it, the
  21. routine resided at 20000 a disassembly
  22. of $20000 would reveal ...
  23.  
  24. {420000 Bra $20000
  25.  
  26. {1Now, If the executable loaded at
  27. $40000, Then the code would read
  28.  
  29. {440000 Bra $40000
  30.  
  31. {1If you cant understand that then you
  32. must be dull as fuck.  But never mind.
  33.  
  34. {4Okay, all you have to do is...
  35.  
  36.  
  37.         Section Checksum,code_C
  38.  
  39.         Jsr     Checksum(pc)
  40.         Cmp.l   #$00000000,d1
  41.         Beq.s   Checksumright
  42.  
  43.         Jmp     $fc00d0
  44. {1Or whatever you wanna do when the text
  45. has been changed. (I like to display a
  46. nasty message first personally!)
  47.  
  48. {5Checksumright:
  49.         ...
  50.         Your code goes here
  51.         ...
  52.         Rts
  53.  
  54.  
  55. {5Checksum
  56.         Lea     Datastart(pc),a0
  57.         Move.l  #Dataend-Datastart,d0
  58. {5Loop:
  59.   {4      Add.l   (a0)+,d1
  60.         dbra    d0,loop
  61.         Rts
  62.  
  63. {5Datastart:  
  64. Screen dc.l 0 Logo incbin
  65. "Df0:Graphics/logo.raw" 
  66.  
  67. {5Music incbin
  68. "DF0:music/mod.cheesy module"
  69.  
  70. {5scrolltext dc.b "Hi welcome to this
  71. checksummer!"
  72.                 even
  73. {4Dataend:
  74.  
  75. {5Thats it!
  76. Assemble it. 
  77. }1(DONT RUN IT! - IT WILL CRASH!)
  78.  
  79. {3Click on Debug (Or Right amiga & D)
  80. trace your way through the prog using
  81. Ctrl and T Note what D1 contains after
  82. the Jsr Checksum Write it down.  Now
  83. press CRTL & C to go back to the
  84. {4Devpac {3screen Change the cmp.l
  85. #$00000000,d1 to whatever the number
  86. you wrote down was!  Reassemble.
  87. Debug again.  Trace your way through a
  88. few lines to ensure that you have put
  89. the right number in the right place!
  90. If all goes well, the texts,logos &
  91. music and anything else you put in
  92. your data division will be
  93. unchangable!  (Without potch anyway)
  94. Once assembled to an executable,
  95. {4Lamer's{3 will have a hard time changing
  96. anything.  And If someone is clever
  97. enough to disassemble the whole
  98. program, change the checksum and the
  99. texts, I think they would also be
  100. clever enough to write the routines in
  101. your program anyway.
  102.  
  103. {2I.e.  Only incompetant lamers with
  104. file editors will try to change texts.
  105.  
  106. {6Terminator
  107.  
  108.  
  109.  
  110.  
  111.  
  112.